<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="../../../js/mui.min.js"></script>
		<link href="../../../css/mui.min.css" rel="stylesheet"/>
		<script src="../../../js/world/NowWorld/main.js"></script>
		<script type="text/javascript" charset="utf-8">
		  	mui.init();
			var buttonVar = "无";
		</script>
	</head>
	
	<body>
		<script>
			setTimeout(function(){
				/* document.getElementById("MyRealmAreaDouble").innerHTML = ;
				document.getElementById("MyEnergyAreaDouble").innerHTML = ;
				document.getElementById("MyAgeAreaDouble").innerHTML = ;
				document.getElementById("MyMindAreaDouble").innerHTML = ; */
				
				document.getElementById("MyAreaBig").innerHTML = plus.storage.getItem("MyAreaBig");
				document.getElementById("MyAreaHasEnergy").innerHTML = plus.storage.getItem("MyAreaHasEnergy");
				document.getElementById("MyAreaPlant").innerHTML = plus.storage.getItem("MyAreaPlant");
				document.getElementById("MyAreaMine").innerHTML = plus.storage.getItem("MyAreaMine");
				document.getElementById("MyAreaBeast").innerHTML = plus.storage.getItem("MyAreaBeast");
				document.getElementById("MyAreaPulse").innerHTML = plus.storage.getItem("MyAreaPulse");
				
				document.getElementsByClassName("凡人")[0].innerHTML = plus.storage.getItem("FanRen");
				document.getElementsByClassName("练气")[0].innerHTML = plus.storage.getItem("LianQi");
				document.getElementsByClassName("筑基")[0].innerHTML = plus.storage.getItem("ZhuJi");
				document.getElementsByClassName("金丹")[0].innerHTML = plus.storage.getItem("JinDan");
				document.getElementsByClassName("元婴")[0].innerHTML = plus.storage.getItem("YuanYing");
			},500);
		</script>
			<!-- 主界面菜单同时移动 -->
				<!-- 侧滑导航根容器 -->
				<div class="mui-off-canvas-wrap mui-draggable">
					<!-- 主页面容器 -->
					<div class="mui-inner-wrap">
						<!-- 菜单容器 -->
						<aside class="mui-off-canvas-left" id="offCanvasSide">
							<div class="mui-scroll-wrapper">
								<div class="mui-scroll">
									<!-- 菜单具体展示内容 -->
									<a href="../../../index.html"><button type="button" class="mui-btn mui-btn-blue mui-btn-block">回到主页</button></a>
									<a href="home.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">自我</button></a>
									<a href="run.html"><button type="button" class="mui-btn mui-btn-purple mui-btn-block">发展</button></a>
									<a href="talk.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">外交</button></a>
									<a href="cultrue.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">文化</button></a>
									<a href="immortal.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">仙魔</button></a>
								</div>
							</div>
						</aside>
						
						<header class="mui-bar mui-bar-nav"><!-- 主页面标题 -->
							<a class="mui-icon mui-action-menu mui-icon-bars mui-pull-left" href="#offCanvasSide"></a>
							<h1 class="mui-title">发展</h1>
						</header>
						<!-- 主页面内容容器 -->
						<div class="mui-content mui-scroll-wrapper">
							<div class="mui-scroll">
								<!-- 主界面具体展示内容 -->
								<ul class="mui-table-view">
									<li class="mui-table-view-cell mui-collapse">
										<a class="mui-navigate-right" href="#"><span class="mui-icon mui-icon-location"></span>地界加成</a>
										<div class="mui-collapse-content">
											<div class="mui-row">
												<div class="mui-col-sm-6 mui-col-xs-6"><p>突破倍率:<b id="MyRealmAreaDouble">0</b></p></div>
												<div class="mui-col-sm-6 mui-col-xs-6"><p>灵力倍率:<b id="MyEnergyAreaDouble">0</b></p></div>
												<div class="mui-col-sm-6 mui-col-xs-6"><p>寿元倍率:<b id="MyAgeAreaDouble">0</b></p></div>
												<div class="mui-col-sm-6 mui-col-xs-6"><p>道心增减:<b id="MyMindAreaDouble">0</b></p></div>
											</div>
										</div>
									</li>
									<li class="mui-table-view-cell mui-collapse">
										<a class="mui-navigate-right" href="#">我的领土</a>
										<div class="mui-collapse-content">
											<div class="mui-row">
												<div class="mui-col-xs-6 mui-col-sm-6">领土大小:<b id="MyAreaBig">0</b></div>
												<div class="mui-col-xs-6 mui-col-sm-6">领土聚灵:<b id="MyAreaHasEnergy">0</b></div>
												<div class="mui-col-xs-6 mui-col-sm-6">灵植数量:<b id="MyAreaPlant">0</b></div>
												<div class="mui-col-xs-6 mui-col-sm-6">灵矿数量:<b id="MyAreaMine">0</b></div>
												<div class="mui-col-xs-6 mui-col-sm-6">灵兽数量:<b id="MyAreaBeast">0</b></div>
												<div class="mui-col-xs-6 mui-col-sm-6">灵脉大小:<b id="MyAreaPulse">0</b></div>
											</div>
										</div>
									</li>
									<li class="mui-table-view-cell mui-collapse">
										<a class="mui-navigate-right" href="#">领地子民</a>
										<div class="mui-collapse-content">
											<p>凡人:<b class="凡人">0</b></p>
											<p>练气:<b class="练气">0</b></p>
											<p>筑基:<b class="筑基">0</b></p>
											<p>金丹:<b class="金丹">0</b></p>
											<p>元婴:<b class="元婴">0</b></p>
										</div>
									</li>
								</ul>
								
								
								<div class="mui-row">
									<div class="mui-col-xs-12 mui-col-sm-12" style="text-align: center;">数值<br><input type="number" name="InNumber" style="width: 90%;"></div>
									
									<div class="mui-col-xs-6 mui-col-sm-6"><button onclick="JuLing()" type="button" class="mui-btn mui-btn-green mui-btn-outlined" style="width: 100%;font-size: 130%;">聚灵</button></div>
									<div class="mui-col-xs-6"><button onclick="TuPo()" type="button" class="mui-btn mui-btn-green mui-btn-outlined" style="width: 100%;font-size: 130%;">突破</button></div>
								</div>
								<script>
									function JuLing(){
										var inputVar = document.getElementsByName('InNumber');
										if(buttonVar!="聚灵"){
											buttonVar="聚灵";
											document.getElementById("tip1").innerHTML="聚灵可生产出灵植等,是否要聚灵"+String(inputVar[0].value)+"灵";
										}else{
											if(inputVar[0].value==""){document.getElementById("tip1").innerHTML="要聚灵请先输入聚灵数值";buttonVar="无";return 0;}
											if(Number(inputVar[0].value)>Number(plus.storage.getItem("MyEnergy"))){
												document.getElementById("tip1").innerHTML="灵气不足";
											}else{
												plus.storage.setItem("MyAreaHasEnergy",String(Number(plus.storage.getItem("MyAreaHasEnergy"))+Number(inputVar[0].value)));
												plus.storage.setItem("MyEnergy",String(Number(plus.storage.getItem("MyEnergy"))-inputVar[0].value));
	
												document.getElementById("tip1").innerHTML="聚灵完成";
											}
											buttonVar="无";
										}
									}
									function TuPo(){
										var inputVar = document.getElementsByName('InNumber');
										if(buttonVar!="突破"){
											buttonVar="突破";
											document.getElementById("tip1").innerHTML="消耗领地的灵气使子民们突破!";
										}else{
											var giveVar;
											if(inputVar[0].value==""){document.getElementById("tip1").innerHTML="请先输入突破给予的灵气数值";buttonVar="无";return 0;}
											if(Number(inputVar[0].value)>Number(plus.storage.getItem("MyAreaHasEnergy"))){document.getElementById("tip1").innerHTML="灵气不足";}else{
												giveVar = Number(inputVar[0].value);
												
												//plus.storage.setItem("MyAreaHasEnergy",String(Number(plus.storage.getItem("MyAreaHasEnergy"))-Number(inputVar[0].value)));
												//if(Number(plus.storage.getItem("YuanYing"))>1&&giveVar>MyRealmUpEnergyHelp("")){
													
											}
											function JinJi(Level,zh_Level,upLevel){
												if(Number(plus.storage.getItem(Level))>1&&giveVar>MyRealmUpEnergyHelp("金丹后期")){
													//晋级人数
													var overHelp = giveVar > Number(plus.storage.getItem(Level)) * MyRealmUpEnergyHelp("金丹后期") ? parseInt(Number(plus.storage.getItem(Level))) : parseInt(giveVar/MyRealmUpEnergyHelp(zh_Level));
													giveVar -= overHelp * MyRealmUpEnergyHelp(zh_Level) / 2;//减去所需灵气
													plus.storage.setItem(Level,String(Number(plus.storage.getItem(Level))-(overHelp/2)));
													plus.storage.setItem(Level,String(Number(plus.storage.getItem(upLevel))+(overHelp/2)));
												}
											}
											JinJi("JinDan","金丹后期","YuanYing");
											JinJi("ZhuJi","筑基后期","JinDan");
											JinJi("LianQi","练气后期","ZhuJi");
											JinJi("FanRen","凡人","LianQi");
										}
									}
									
								</script>
								
								
								<h4>提示栏:</h4>
									<p id="tip1">本页时间不进行</p>
								<h4>消息栏:</h4>
									<p id="tip2">暂无消息</p>
							</div>
						</div>
				   	 <div class="mui-off-canvas-backdrop"></div>
					</div>
				</div>
		</body>
	
</html>